﻿// Original author contact info: Owen Emlen (owene_1998@yahoo.com)
// Note: other individuals may also have contributed to this code
// Project hosted on CodePlex.com as of 1/10/2009 at http://www.codeplex.com/EmlenMud
using System;
using System.Runtime.Serialization;
using System.ComponentModel;

namespace BrainTechLLC
{
    [Serializable]
#if NO_SILVERLIGHT
    [Browsable(true)]
    [TypeConverter(typeof(ExpandableObjectConverter))]
#endif
    [DataContract]
    public class PositionAndSpeedInt : SpeedInt, IHasSpeedInt, IHasLocationInt, IPositionAndSpeedInt, IVector4Int, IDirectionInt, IQuickCopy
    {
        public PositionAndSpeedInt(PositionInt pos) : base() { Position = new PositionInt(pos); }
        public PositionAndSpeedInt(PositionInt pos, SpeedInt speed) : base(speed) { Position = new PositionInt(pos); }
        public PositionAndSpeedInt(SpeedInt speed) : base(speed) { Position = new PositionInt(); }
        public PositionInt Position { get; set; }
        public GeneralDirection CardinalDirection { get { return DirectionVector.CardinalDirection; } }
        public DirectionInt GetSymmetric(Symmetry symmetry) { return DirectionVector.GetSymmetric(symmetry); }
        public LocationInt LocationInt { get { return Position.LocationInt; } }
        public DirectionInt DirectionVector { get { return Position.DirectionVector; } set { Position.DirectionVector = value; } }
        public PositionAndSpeedInt() : base() { }
        public new object Copy()
        {
            PositionInt pos = new PositionInt(this.Position);
            return new PositionAndSpeedInt(this) { Position = pos };
        }
    }
}
